<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Mosaddek">
    <meta name="keyword" content="FlatLab, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
    <link rel="shortcut icon" href="newtemplatesfiles5/img/favicon.html">

    <title>我的电动车</title>

    <!-- Bootstrap core CSS -->
    <link href="newtemplatesfiles5/css/bootstrap.min.css" rel="stylesheet">
    <link href="newtemplatesfiles5/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="newtemplatesfiles5/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="newtemplatesfiles5/css/style.css" rel="stylesheet">
    <link href="newtemplatesfiles5/css/style-responsive.css" rel="stylesheet" />

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
    <script src="newtemplatesfiles5/js/html5shiv.js"></script>
    <script src="newtemplatesfiles5/js/respond.min.js"></script>
    <![endif]-->

    <!--弹出框style-->
    <style>
        /*弹出层*/
        #popBox {
            display: none;
            background-color: honeydew;
            z-index: 11;
            width: 600px;
            height: 600px;
            position:fixed;
            top:0;
            right:0;
            left:0;
            bottom:0;
            margin:auto;
        }

        #popBox .close{
            text-align: right;
            margin-right: 5px;
            background-color: #F8F8F8;
        }

        /*关闭按钮*/
        #popBox .close a {
            text-decoration: none;
            color: red;
        }

        #popBox .auto {
            margin-left: 50px;
            margin-right: 50px;
            margin-top: 50px;

        }
        .box::before {

            content: "";
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 2;
            background-color: #000;
            opacity: .3;
        }
    </style>

</head>

<body>

<section id="container" class="">
    <!--header start-->
    <div th:insert="common/student-common-header::top"></div>
    <!--header end-->
    <!--sidebar start-->
    <div th:insert="common/student-common-sidebar::#left"></div>
    <!--sidebar end-->
    <!--main content start-->
    <section id="main-content">
        <section class="wrapper">
            <!-- page start-->
            <div class="row">
                <!--student-info-left  start-->
                <div th:insert="common/student-info-left::#student-info-left"></div>
                <!--student-info-left  end-->
                <aside class="profile-info col-lg-9">
                    <!--widget start-->

                    <!--widget end-->
                    <table class="table table-striped table-sm">
                        <thead>
                        <div class="bio-graph-heading">
                            <h2>我的电动车</h2>
                        </div>
                        </thead>
                        <tbody>
                                    <h2>有证的电动车</h2>
                                    <tr th:each="emp:${session.haveEvidenceebickList}">
                                        <section class="panel">
                                        <div class="panel-body bio-graph-info">
                                            <div class="row">
                                                <div class="bio-row">
                                                    <label>车牌号 :</label><a class="ebickID" th:text="${emp.ebickID}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>品牌 :</label><a th:text="${emp.brand}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>卖方商家和地址 :</label><a th:text="${emp.buyfrom}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>首次注册时间 :</label><a th:text="${emp.firstRegistTime}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>备注 :</label><a th:text="${emp.details}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>状态 :</label><a th:text="${emp.status}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>电动车照片 :</label><img style="width: 60px" th:src="${emp.image eq null ? 'asserts/img/YSU.jpg':emp.image}">
                                                </div>
                                                <div class="bio-row">
                                                    <button class="btn btn-info" onclick="getQRcode(this)"><i class="icon-qrcode"></i>&nbsp;查看二维码</button>
                                                </div>

                                            </div>
                                        </div>
                                        </section>
                                    </tr><br>
                                    <h2>无证的电动车</h2>
                                    <tr th:each="emp:${session.notHaveEvidenceebickList}">
                                        <section class="panel">
                                        <div class="panel-body bio-graph-info">
                                            <div class="row">
                                                <div class="bio-row">
                                                    <label>车牌号 :</label><a class="ebickID" th:text="${emp.ebickID}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>品牌 :</label><a th:text="${emp.brand}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>卖方商家和地址 :</label><a th:text="${emp.buyfrom}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>首次注册时间 :</label><a th:text="${emp.firstRegistTime}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>备注 :</label><a th:text="${emp.details}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>状态 :</label><a th:text="${emp.status}"></a>
                                                </div>
                                                <div class="bio-row">
                                                    <label>电动车照片 :</label><img style="width: 60px" th:src="${emp.image eq null ? 'asserts/img/YSU.jpg':emp.image}">
                                                </div>
                                                <div class="bio-row">
                                                    <button class="btn btn-info" onclick="getQRcode(this)"><i class="icon-qrcode"></i>&nbsp;查看二维码</button>
                                                </div>
                                                <footer class="twt-footer">
                                                    <a th:href="@{/applyForDrivingLicense.do(ebickID=${emp.ebickID})}">
                                                        <button class="btn btn-sm btn-danger">
                                                            <i class="icon-location-arrow"></i>
                                                            申请行驶证明</button>
                                                    </a>
                                                    <a th:href="@{/student-to-uploadGoodsEbick.do(ebickID=${emp.ebickID})}">
                                                        <button class="btn btn-sm btn-danger">
                                                            <i class="icon-shopping-cart"></i>
                                                            售卖</button>
                                                    </a>
                                                    <a th:href="@{/cancleApplyForDrivingLicense.do(ebickID=${emp.ebickID})}">
                                                        <button class="btn btn-sm btn-danger" >
                                                            <i class="icon-rotate-left (alias)"></i>
                                                            撤回申请</button>
                                                    </a>
                                                </footer>
                                            </div>
                                        </div>
                                        </section>
                                    </tr>
                        </tbody>
                    </table>
                    <div id="mybox" class="box" style="display: none;">
                        <div id="popBox" name="popBox" class="popBox content-center">
                                <div class="close">
                                    <a href="javascript:void(0)" onclick="closeBox()">关闭</a>
                                </div>
                                <div class="auto">
                                    <img width="100%" id="RQCodeImg" alt="">
                                </div>
                                <div style="margin-top: 3px;margin-left: 220px">
                                    <h2  id="ebickIDH"></h2>
                                </div>

                        </div>
                    </div>

                </aside>
            </div>

            <!-- page end-->
        </section>
    </section>

    <!--main content end-->
    <!--消息标签-->
    <a type="hidden" id="applyForMessage" th:text="${session.applyForMessage eq null ? 'null' : session.applyForMessage}"></a>

</section>
<script type="text/javascript" src="asserts/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="asserts/js/popper.min.js"></script>
<script src="asserts/js/feather.min.js"></script>
<script src="asserts/js/bootstrap.min.js"></script>
<!-- js placed at the end of the document so the pages load faster -->
<script src="newtemplatesfiles5/js/jquery.js"></script>
<script src="newtemplatesfiles5/js/bootstrap.min.js"></script>
<script src="newtemplatesfiles5/js/jquery.scrollTo.min.js"></script>
<script src="newtemplatesfiles5/js/jquery.nicescroll.js" type="text/javascript"></script>
<script src="newtemplatesfiles5/assets/jquery-knob/js/jquery.knob.js"></script>

<!--common script for all pages-->
<script src="newtemplatesfiles5/js/common-scripts.js"></script>
<script>
    /*点击弹出按钮*/
    function popBox() {
        var popBox = document.getElementsByClassName("popBox")[0];
        popBox.style.display = "block";
        var box = popBox.parentElement;
        box.style.display = "block";
    };
    /*点击关闭按钮*/
    function closeBox() {
        var popBox = document.getElementById("mybox");
        popBox.style.display = "none";
    }
</script>
<script>
    function getQRcode(obj) {
        var ebickID = obj.parentElement.parentElement.getElementsByClassName("ebickID")[0].textContent;
        var form = new FormData();
        form.append("content",ebickID);
        $.ajax({
            url:"encode-qrcode.do",
            type:"post",
            dataType:"html",
            data:form,
            cache:false,
            processData:false,
            contentType:false,
            success: function (data) {
                if(data=="error"){
                    alert("系统错误");
                }else {
                    ////弹框展示
                    //alert(data);
                    popBox();
                    document.getElementById("RQCodeImg").src=data;
                    document.getElementById("ebickIDH").innerText=ebickID;
                }
            },
            error:function (e) {
                console.log(e);
                alert("系统错误");
            }
        })
    }
</script>
<script>
    window.onload=function(){
        $("#li1").removeClass('active');
        $("#li2").removeClass('active');
        $("#li3").addClass('active');
        $("#li4").removeClass('active');
        $("#li5").removeClass('active');
        $("#li6").removeClass('active');
        $("#li7").removeClass('active');


        console.log("onloaded");
        var message = document.getElementById("applyForMessage").innerText;
        console.log("message");
        console.log(message);
        if(message!="null"){
            alert(message);
            location.href="clearMessage.do?sessionItem=applyForMessage&from=newShowMyEbick";
        }
        //alert(message);

    };
    //knob
    $(".knob").knob();

</script>


</body>
</html>
